var Sequelize = require('sequelize');//引入Sequelize模块
var CONFIG = require('./mysql/mysql');
//实例化数据库对象
var sequelize = new Sequelize (
    CONFIG.mysql.database,
    CONFIG.mysql.user,
    CONFIG.mysql.password,{
        host:CONFIG.mysql.host,
        dialect: 'mysql', //数据库类型
        logging: CONFIG.DEBUG? console.log :false, //是否打印日志
        //配置数据库连接池
        pool:{
            max:15,
            min:0,
            idle:10000
        },
        timezone: '+08:00' //时区设置
    }
);
// console.log('datebase config:',sequelize)
module.exports = sequelize; //导出实例化数据库对象